﻿<%@ Page Language="vb" AutoEventWireup="false" CodeFile="ProductInput.aspx.vb" Inherits="_ProductInput" MasterPageFile="~/ITProfessionals.master"%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div style="text-align: left">
<br />
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
        ConflictDetection="CompareAllValues" DataFile="~/Access_db/Jobs.mdb" 
        DeleteCommand="DELETE FROM [tblProducts] WHERE [ProdID] = ? AND [ProdName] = ? AND [ProdDesc] = ? AND [ProdQty] = ? AND [ProdPurchasePrice] = ? AND [ProdSalePrice] = ? AND [ProdLocation] = ? AND [ProdStatus] = ?" 
        InsertCommand="INSERT INTO [tblProducts] ([ProdName], [ProdDesc], [ProdQty], [ProdPurchasePrice], [ProdSalePrice], [ProdLocation], [ProdStatus]) VALUES (?, ?, ?, ?, ?, ?, ?)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT * FROM [tblProducts] ORDER BY [ProdName], [ProdLocation]" 
        
        UpdateCommand="UPDATE [tblProducts] SET [ProdName] = ?, [ProdDesc] = ?, [ProdQty] = ?, [ProdPurchasePrice] = ?, [ProdSalePrice] = ?, [ProdLocation] = ?, [ProdStatus] = ? WHERE [ProdID] = ? AND [ProdName] = ? AND [ProdDesc] = ? AND [ProdQty] = ? AND [ProdPurchasePrice] = ? AND [ProdSalePrice] = ? AND [ProdLocation] = ? AND [ProdStatus] = ?">
        <DeleteParameters>
            <asp:Parameter Name="original_ProdID" Type="Int32" />
            <asp:Parameter Name="original_ProdName" Type="String" />
            <asp:Parameter Name="original_ProdDesc" Type="String" />
            <asp:Parameter Name="original_ProdQty" Type="Int16" />
            <asp:Parameter Name="original_ProdPurchasePrice" Type="Single" />
            <asp:Parameter Name="original_ProdSalePrice" Type="Single" />
            <asp:Parameter Name="original_ProdLocation" Type="String" />
            <asp:Parameter Name="original_ProdStatus" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="ProdName" Type="String" />
            <asp:Parameter Name="ProdDesc" Type="String" />
            <asp:Parameter Name="ProdQty" Type="Int16" />
            <asp:Parameter Name="ProdPurchasePrice" Type="Single" />
            <asp:Parameter Name="ProdSalePrice" Type="Single" />
            <asp:Parameter Name="ProdLocation" Type="String" />
            <asp:Parameter Name="ProdStatus" Type="String" />
            <asp:Parameter Name="original_ProdID" Type="Int32" />
            <asp:Parameter Name="original_ProdName" Type="String" />
            <asp:Parameter Name="original_ProdDesc" Type="String" />
            <asp:Parameter Name="original_ProdQty" Type="Int16" />
            <asp:Parameter Name="original_ProdPurchasePrice" Type="Single" />
            <asp:Parameter Name="original_ProdSalePrice" Type="Single" />
            <asp:Parameter Name="original_ProdLocation" Type="String" />
            <asp:Parameter Name="original_ProdStatus" Type="String" />
        </UpdateParameters>
        <InsertParameters>            
            <asp:Parameter Name="ProdName" Type="String"/>
            <asp:Parameter Name="ProdDesc" Type="String" DefaultValue="Computer" />
            <asp:Parameter Name="ProdQty" Type="Int16"  DefaultValue="0" />
            <asp:Parameter Name="ProdPurchasePrice" Type="Single" DefaultValue="0" />
            <asp:Parameter Name="ProdSalePrice" Type="Single" DefaultValue="0" />
            <asp:Parameter Name="ProdLocation" Type="String" DefaultValue="W1" />
            <asp:Parameter Name="ProdStatus" Type="String" DefaultValue="available" />
        </InsertParameters>
    </asp:AccessDataSource>
    
    <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="600px" 
        AllowPaging="True" AutoGenerateRows="False" DataKeyNames="ProdID" 
        DataSourceID="AccessDataSource1">
        <Fields>
            <asp:BoundField DataField="ProdID" HeaderText="Product ID: " InsertVisible="False" 
                ReadOnly="True" SortExpression="ProdID" />
            <asp:BoundField DataField="ProdName" HeaderText="Name: " 
                SortExpression="ProdName" />
            <asp:BoundField DataField="ProdDesc" HeaderText="Description: " 
                SortExpression="ProdDesc" />
            <asp:BoundField DataField="ProdQty" HeaderText="Qty: " 
                SortExpression="ProdQty" />
            <asp:BoundField DataField="ProdPurchasePrice" HeaderText="Purchased Price: " 
                SortExpression="ProdPurchasePrice" />
            <asp:BoundField DataField="ProdSalePrice" HeaderText="Sale Price: " 
                SortExpression="ProdSalePrice" />
            <asp:BoundField DataField="ProdLocation" HeaderText="Location: " 
                SortExpression="ProdLocation" />
            <asp:BoundField DataField="ProdStatus" HeaderText="Status: " 
                SortExpression="ProdStatus" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>
</div>
<br />       
    
</asp:Content>
